﻿using ExaminationWeb.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace ExaminationWeb.Controllers
{
    public class AccountController : Controller
    {
      
        //
        // GET: /Account/
        [AllowAnonymous]
        public ActionResult Login()
        {
            return View();
        }
        [AllowAnonymous]
        public ActionResult CustomsLogin()
        {
            //STYService.SantongyiServiceClient client = new STYService.SantongyiServiceClient();
            //string outMsg;
            //client.GetPersonIndentityInfo("windows", STYService.PersonIdentityObjectCategory.LOGON_NAME, "", "", out outMsg);

            Session[WebConstants.UserIDSession] = "7D372642-AA1C-4874-AF01-C589793BF31A";
            UserAccount.UserID = Guid.Parse("7D372642-AA1C-4874-AF01-C589793BF31A");
            string fromurl = Request.UrlReferrer.Query;

            if (fromurl.IndexOf("?fromurl=") > -1)
            {
                fromurl = fromurl.Substring(9);
                fromurl = VerifyTool.Decode(fromurl, "Wicresoft");
                return this.Redirect(fromurl);
            }
            else
            {
                return this.Redirect("/Home/Index");
            }

        }
    }
}
